In Slack notifications which are created due to incidents from things like Cloudwatch and Prometheus Alert Manager there is a Triggered by field which links through to the source, how do I set this on notifications generated by the Events API? I have set a link in links
but that doesnât show and I canât find any additional information on this
Triggered by field on slack notification
Hello @stephen!
I was able to make it work after discussing this internally with our teams and running a few tests. The Slack integration looks into a client field inside custom_details. If you send a payload to Events API similar to the one below it should work.
{
"payload": {
"summary": "DISK at 99% on machine prod-datapipe03.example.com",
"timestamp": "2024-02-05T16:42:58.315+0000",
"severity": "critical",
"source": "prod-datapipe03.example.com",
"component": "mysql",
"group": "prod-datapipe",
"class": "disk",
"custom_details": {
"free space": "1%",
"ping time": "1500ms",
"load avg": 0.75,
"client": "Postman" // THIS IS THE ONLY THING YOU NEED TO ADD TO YOUR EVENT
}
},
"event_action": "trigger",
"routing_key": "YOUR_ROUTING_KEY"
}
Let me know if this worked for you or not. And since this is not well documented Iâll look into updating the documentation for the next person to avoid this challenge.
Really? I got it working with client and client_url outside of payload, shown in the example here https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTgx-send-an-alert-event although not mentioned anywhere else on the page
You are correct @stephen. For some strange reason, I probably documented the tests I performed earlier poorly. Iâve ran the tests and you I can confirm the triggered by
field shows up when I send client
and client_url
outside of payload.
Iâll add this to the how-toâs in the community forums shortly for anyone else looking for the same thing. Thanks!
@tiago.barbosa I noticed yesterday that the Slack notifications changed, the big icon on the right hand side is gone and there is now a little circle next to the name of the alert⌠fair enough
but the âTriggered byâ is gone as well and there is just âvia XYZâ at the bottom but that does not link through to the client_url, that is a huge step back in usability
Thanks for reporting it @stephen. I still see the âTriggered byâ message in the bottom. But the link points to the integration defined on the service, not the actual source of the event (Postman in my case).
In order to navigate to the client url you would need to open the incident, scroll down to the alert and click on the client link.
Iâll pass this feedback to the team responsible for the Slack extension so they are aware of your feedback. Thanks!
Thanks, I understand that you can still find the link within PagerDuty but itâs now an extra click, having to log in and scrolling to get to the information, which just slows things down